<template>
  <div :class="prefixCls">
    <div :class="[prefixCls + '-item']" v-for="(item, index) in getActions" :key="index">
      <Button v-bind="getBindValues($attrs, item)" :style="item.style" @click="item.onClick">{{ item.label }}</Button>
    </div>
  </div>
</template>

<script setup>
import { useAction } from './utils/useAction';

const prefixCls = 'sh-table-action';
const props = defineProps({
  actions: {
    type: Array,
    default: () => {
      return [];
    },
  },
});

const { getActions, getBindValues } = useAction(props);
</script>
